<% layout('/layouts/default.html', {title: '员工信息管理', libs: ['validate','fileupload']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text(comEmployee.isNewRecord ? '新增com_employee' : '编辑com_employee')}
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${comEmployee}" action="${ctx}/employee/comEmployee/save" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="form-unit">${text('基本信息')}</div>
				<#form:hidden path="id"/>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								 ${text('姓名')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								${comEmployee.name}
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								${text('年龄')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								${comEmployee.age}
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								 ${text('性别')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<% if(comEmployee.sex ==0){ %>
									女
								<% } %>
								<% if(comEmployee.sex ==1){ %>
									男
								<% } %>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								 ${text('身份证号码')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								${comEmployee.idNum}
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('联系电话')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								${comEmployee.tel}
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('职务')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<!--<#form:input path="duty" maxlength="255" class="form-control"/>-->
							</div>
						</div>
					</div>
				</div>

				<div class="form-unit">${text('在职信息')}</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('所在企业')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								${comEmployee.companyName}
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('入职日期')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								${comEmployee.entryDate,"yyyy-MM-dd"}
							</div>
						</div>
					</div>
				</div>

				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4">${text('职务')}：</label>
							<div class="col-sm-8">
								${comEmployee.duty}
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4">${text('培训日期')}：</label>
							<div class="col-sm-8">
								${comEmployee.trainDate,"yyyy-MM-dd"}
							</div>
						</div>
					</div>
				</div>

				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('部门')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">

							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('班组')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">

							</div>
						</div>
					</div>
				</div>

				<div class="form-unit">${text('健康证信息')}</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('是否必传')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:radio path="must_health" dictType="com_must_health" class="form-control" />
							</div>
						</div>
					</div>
				</div>

				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('健康证编号')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="healthNum" maxlength="255" class="form-control"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								 ${text('健康证类别')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="healthType" maxlength="255" class="form-control"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								 ${text('健康证起始日期')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="healthStart" readonly="true" maxlength="20" class="form-control Wdate"
										dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('健康证过期日期')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="healthEnd" readonly="true" maxlength="20" class="form-control Wdate"
										dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
							</div>
						</div>
					</div>
				</div>

				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('发证机构')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="organization" maxlength="255" class="form-control"/>
							</div>
						</div>
					</div>
				</div>

				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4">${text('健康证图片')}：</label>
							<div class="col-sm-8">
								<#form:fileupload id="uploadImage" returnPath="true" bizKey="${comEmployee.id}" bizType="healthPicture" maxUploadNum="1"
										uploadType="image" class="" readonly="false"/>
							</div>
						</div>
					</div>
				</div>


			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<% if (hasPermi('employee:comEmployee:edit')){ %>
							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;
						<% } %>
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});
</script>